class Company < Party
  
  def after_initialize
    @work_type = AddressType.find_by_code(0)
  end
  
  def address
   @address = addresses.find(:first, :conditions => ["address_type_id = ?", @work_type.id ]) unless addresses.empty?
  end
  
  def address=(addr)
    addr.address_type = @work_type
    addresses.push(addr)
  end
  
end